Allow 'list' as alias for '-1' for device discovery.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 20 Apr 2006 19:11:37 +0000 (19:11 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 20 Apr 2006 19:11:37 +0000 (19:11 +0000)
gpsbabel/jeeps/gpslibusb.c
gpsbabel/jeeps/gpsusbwin.c

index d282e4ee35e773f868d4f031ef98b2700383db07..0adbf77edc8dcbde2def133e5ccd949ba5a3ed3a 100644 (file)
@@ -232,7 +232,11 @@ gusb_init(const char *portname, gpsdevh **dh)
 
        /* if "usb:N", read "N" to be the unit number. */
        if (strlen(portname) > 4) {
-               req_unit_number = atoi(portname + 4);
+               if (0 == strcmp(portname+4, "list")) {
+                       req_unit_number = -1;
+               } else {
+                       req_unit_number = atoi(portname + 4);
+               }
        }
 
        usb_find_busses();
index cd217cb67647d5188b428e49c09c612e860ce634..b14ca2fd0c01e54facb7b5f5a324b94d38d75f73 100644 (file)
@@ -202,7 +202,11 @@ gusb_init(const char *pname, gpsdevh **dh)
        gusb_register_ll(&win_llops);
 
        if (strlen(pname) > 4) {
-               req_unit_number = atoi(pname+4);
+               if (0 == strcmp(portname+4, "list")) {
+                       req_unit_number = -1;
+               } else {
+                       req_unit_number = atoi(pname+4);
+               }
        }
 
        hdevinfo = SetupDiGetClassDevs( (GUID *) &GARMIN_GUID, NULL, NULL,